.monaco-code-viewer-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

// 头部信息栏
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(135deg, #007acc, #0056b3);
  color: white;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;

  .file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;

    .file-title {
      margin: 0;
      font-size: 20px;
      font-weight: 600;
      color: white;
    }

    .file-details {
      font-size: 14px;
      color: rgba(255, 255, 255, 0.9);
    }

    .feature-badge {
      font-size: 12px;
      color: #ffeb3b;
      font-weight: 500;
    }
  }

  .actions {
    display: flex;
    gap: 12px;
  }
}

// 按钮样式
.btn {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  text-decoration: none;

  &:hover {
    background: rgba(255, 255, 255, 0.3);
  }

  &:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
  }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: white;

  &:hover {
    background: rgba(255, 255, 255, 0.25);
  }
}

// 加载状态
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px;

  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007acc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
  }

  p {
    color: #666;
    font-size: 16px;
    margin: 0;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

// 错误状态
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px;
  text-align: center;

  .error-icon {
    font-size: 48px;
    margin-bottom: 16px;
  }

  .error-message {
    color: #dc3545;
    font-size: 16px;
    margin-bottom: 24px;
    max-width: 400px;
  }
}

// 主内容区域
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

// 区域信息面板
.regions-panel {
  width: 300px;
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
  padding: 20px;
  overflow-y: auto;
  flex-shrink: 0;

  h3, h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
  }

  h4 {
    font-size: 14px;
    margin: 20px 0 12px 0;
  }

  .regions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
  }

  .region-item {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    transition: all 0.2s ease;

    &:hover {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      border-color: #007acc;
    }

    .region-info {
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-bottom: 8px;

      .region-name {
        font-weight: 500;
        color: #333;
        font-size: 14px;
      }

      .region-lines {
        font-size: 12px;
        color: #666;
      }
    }

    .region-status {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 8px;

      .status-badge {
        background: #d4edda;
        color: #155724;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        border: 1px solid rgba(0, 0, 0, 0.1);
      }
    }

    .region-actions {
      display: flex;
      justify-content: center;

      .btn-small {
        padding: 4px 8px;
        background: #007acc;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
        transition: all 0.2s;

        &:hover {
          background: #005a9e;
          transform: scale(1.05);
        }
      }
    }
  }

  // Monaco Editor 功能面板
  .monaco-features {
    border-top: 1px solid #e9ecef;
    padding-top: 16px;
    margin-bottom: 20px;

    .feature-buttons {
      display: flex;
      flex-direction: column;
      gap: 8px;

      .btn-feature {
        display: block;
        width: 100%;
        padding: 8px 12px;
        background: linear-gradient(135deg, #007acc, #0056b3);
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 13px;
        font-weight: 500;
        transition: all 0.2s;

        &:hover {
          transform: translateY(-1px);
          box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3);
        }
      }
    }
  }

  // 优势展示
  .advantages {
    border-top: 1px solid #e9ecef;
    padding-top: 16px;

    .advantage-list {
      margin: 0;
      padding: 0;
      list-style: none;

      li {
        font-size: 12px;
        color: #666;
        line-height: 1.6;
        margin-bottom: 4px;
        padding-left: 4px;

        &:before {
          margin-right: 6px;
        }
      }
    }
  }
}

// 编辑器容器
.editor-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;

  .editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f1f3f4, #e8eaed);
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;

    .editor-title {
      font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
      font-size: 14px;
      font-weight: 500;
      color: #333;
    }

    .editor-language {
      font-size: 12px;
      color: #666;
      background: #e9ecef;
      padding: 2px 8px;
      border-radius: 12px;
    }

    .implementation-badge {
      font-size: 11px;
      background: linear-gradient(135deg, #007acc, #0056b3);
      color: white;
      padding: 2px 8px;
      border-radius: 12px;
      font-weight: 600;
    }
  }

  .monaco-editor-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    border: 1px solid #e9ecef;
    border-radius: 0 0 4px 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  }
}

// 功能说明
.help-panel {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-top: 1px solid #e9ecef;
  padding: 16px 24px;
  flex-shrink: 0;

  details {
    summary {
      cursor: pointer;
      font-weight: 600;
      color: #007acc;
      font-size: 15px;
      
      &:hover {
        color: #005a9e;
      }
    }

    .help-content {
      margin-top: 16px;
      
      .feature-comparison {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        margin-top: 12px;

        .feature-col {
          h5 {
            margin: 0 0 12px 0;
            font-size: 14px;
            font-weight: 600;
            color: #333;
            border-bottom: 2px solid #007acc;
            padding-bottom: 4px;
          }

          ul {
            margin: 0;
            padding-left: 16px;
            
            li {
              font-size: 13px;
              color: #666;
              line-height: 1.6;
              margin-bottom: 6px;

              strong {
                color: #333;
                font-weight: 600;
              }
            }
          }
        }
      }
    }
  }
}

// Monaco Editor 自定义样式
:global {
  // Monaco Editor 行号区域展开样式
  .monaco-line-expand-zone {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    
    .line-number-item {
      user-select: none;
      
      &.expand-up-icon,
      &.expand-down-icon {
        &:hover {
          background: rgba(0, 122, 204, 0.15) !important;
          color: #005a9e !important;
          transform: scale(1.2) !important;
        }
        
        &:active {
          transform: scale(1.0) !important;
        }
      }

      &.expand-all-icon {
        &:hover {
          background: rgba(40, 167, 69, 0.15) !important;
          color: #1e7e34 !important;
          transform: scale(1.3) !important;
        }
        
        &:active {
          transform: scale(1.0) !important;
        }
      }
    }
  }

  // Monaco Editor 折叠指示器样式
  .monaco-collapse-indicator {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
  }

  // 装饰器样式
  .monaco-editor .view-line {
    .region-decoration-0 { border-left: 3px solid #007acc; }
    .region-decoration-1 { border-left: 3px solid #28a745; }
    .region-decoration-2 { border-left: 3px solid #ffc107; }
    .region-decoration-3 { border-left: 3px solid #dc3545; }
  }

  // 行号区域样式
  .monaco-editor .margin {
    background-color: #f8f9fa !important;
  }

  .monaco-editor .line-numbers {
    color: #666 !important;
    font-weight: 500 !important;
  }

  // 滚动条样式
  .monaco-editor .scrollbar {
    .slider {
      background: rgba(0, 122, 204, 0.3) !important;
    }
  }
}

// 用于通过Decoration隐藏Monaco Editor中的行
// 我们将这个样式注入到全局，以确保它能作用于Monaco Editor的DOM
::ng-deep .monaco-hidden-line {
  display: none !important;
}

// 响应式设计
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .regions-panel {
    width: 100%;
    max-height: 300px;
    border-right: none;
    border-bottom: 1px solid #e9ecef;

    .feature-buttons {
      flex-direction: row;
      gap: 6px;

      .btn-feature {
        flex: 1;
        padding: 6px 8px;
        font-size: 11px;
      }
    }
  }

  .header-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;

    .file-info {
      text-align: center;
    }
  }

  .help-panel {
    .feature-comparison {
      grid-template-columns: 1fr;
      gap: 16px;
    }
  }
} 